package com.xjgc.model.entity.crm;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.Locale;

/**
 * CRM系统-投标任务
 *
 * @author: 小逗号
 * @date: 2023-9-13
 * @description:
 * @since:
 */
@Data
public class ZxjCrmBid implements Serializable {
    private static final long serialVersionUID = 1L;
    public static final String API_NAME = "query_bid_obj__c";


    /**投标编号*/
    @JsonProperty("xJ_bid_obj__no")
    @TableId("xJ_bid_obj__no")
    @TableField("xJ_bid_obj__no")
    private String xjBidObjNo;
    /**投标项目名称*/
    @JsonProperty("xj_project_name__c")
    @TableField("xj_project_name__c")
    private String xjProjectNameC;
    /**所在省*/
    @JsonProperty("xj_province__c")
    @TableField("xj_province__c")
    private String xjProvinceC;
    /**责任产业单位编码*/
    @JsonProperty("xj_responsible_department__c")
    @TableField("xj_responsible_department__c")
    private String xjResponsibleDepartmentC;
    /**责任产业单位名称*/
    @JsonProperty("xj_responsible_department_name")
    @TableField("xj_responsible_department_name")
    private String xjResponsibleDepartmentName;
    /**投标主体编码*/
    @JsonProperty("xj_bid_department__c")
    @TableField("xj_bid_department__c")
    private String xjBidDepartmentC;
    /**投标主体名称*/
    @JsonProperty("xj_bid_department_name")
    @TableField("xj_bid_department_name")
    private String xjBidDepartmentName;
    /**签约客户编码*/
    @JsonProperty("xj_account_no")
    @TableField("xj_account_no")
    private String xjAccountNo;
    /**签约客户名称*/
    @JsonProperty("xj_account_name")
    @TableField("xj_account_name")
    private String xjAccountName;
    /**
     * 客户经理编码
     */
    @JsonProperty("owner_no")
    @TableField("owner_no")
//    @TableField(exist = false)
    private String ownerNo;
    /**客户经理名称*/
    @JsonProperty("owner_name")
    @TableField("owner_name")
    private String ownerName;
    /**预计投标金额*/
    @JsonProperty("xj_estimated_bid_amount__c")
    @TableField("xj_estimated_bid_amount__c")
    private BigDecimal xjEstimatedBidAmountC;
    /**投标金额（万元）*/
    @JsonProperty("xj_bid_amount__c")
    @TableField("xj_bid_amount__c")
    private BigDecimal xjBidAmountC;
    /**开标结果*/
    @JsonProperty("xj_bid_opening_result__c")
    @TableField("xj_bid_opening_result__c")
    private String xjBidOpeningResultC;

    /**中标金额（万元）*/
    @JsonProperty("xj_bid_won_amount__c")
    @TableField("xj_bid_won_amount__c")
    private BigDecimal xjBidWonAmountC;

    /**投标类型*/
    @JsonProperty("xj_bid_type__c")
    @TableField("xj_bid_type__c")
    private String xjBidTypeC;
    /**市场大类*/
    @JsonProperty("xj_market_segment1__c")
    @TableField("xj_market_segment1__c")
    private String xjMarketSegment1C;
    /**市场中类*/
    @JsonProperty("xj_market_segment2__c")
    @TableField("xj_market_segment2__c")
    private String xjMarketSegment2C;
    /**市场小类*/
    @JsonProperty("xj_market_segment3__c")
    @TableField("xj_market_segment3__c")
    private String xjMarketSegment3C;


    /**
     * 项目编号
     */
    @JsonProperty("TBXMBH")
    @TableField("TBXMBH")
    private String tbxmbh;
    /**
     * 项目编号
     */
    @JsonProperty("project_number")
    @TableField("project_number")
    private String projectNumber;


    /**中标日期*/
    @JsonFormat(shape = JsonFormat.Shape.NUMBER)
    @JsonProperty("xj_bid_won_date__c")
    @TableField("xj_bid_won_date__c")
    private Date xjBidWonDateC;
    /**预计签回时间*/
    @JsonFormat(shape = JsonFormat.Shape.NUMBER)
    @JsonProperty("xj_estimated_sign_date__c")
    @TableField("xj_estimated_sign_date__c")
    private Date xjEstimatedSignDateC;
    /**商业模式*/
    @JsonProperty("xj_business_mode")
    @TableField("xj_business_mode")
    private String xjBusinessMode;
    /**最后修改时间*/
// Feature = JsonFormat.Feature.WRITE_DATE_TIMESTAMPS_AS_NANOSECONDS
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8",shape = JsonFormat.Shape.NUMBER)
    @JsonProperty("last_modified_time")
    @TableField("last_modified_time")
    private Date lastModifiedTime;

    public void saveBefore(){
        this.tbxmbh = this.projectNumber;
    }

}
